package com.yiheima.exam;


public class GoldCard extends Card {
    public GoldCard(String cardId, String name, String phone, double money) {
        super(cardId, name, phone, money);
    }

    @Override
    public void consume(double money) {
        System.out.println("消费金额：" + money);
        if(getMoney()<money*0.8){
            System.out.println("余额不足，无法消费");
            return;
        }
        setMoney(getMoney() - money*0.8);
        System.out.println("余额：" + getMoney());
        if(money*0.8>200){
            printTicket();
        }
        else{
            //不打印洗车票
            System.out.println("不打印洗车票");
        }

    }
    //打印洗车票
    public void printTicket() {
        System.out.println("打印洗车票");
    }

}
